package animix.test.cicd.controller;

import animix.test.cicd.common.pojo.Result;
import animix.test.cicd.component.AppUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class SystemController {

    @GetMapping("/")
    public Result success() {
        return Result.ok();
    }

    @GetMapping("/sysinfo")
    public Result sysinfo() {
        Map mapInfo = new HashMap();
        mapInfo.put("ActiveProfile", AppUtil.getActiveProfile());
        mapInfo.put("ApplicationName", AppUtil.getApplicationName());
        mapInfo.put("ServerPort", AppUtil.getServerPort());
        mapInfo.put("Version", "v0.0.2");
        return Result.ok(mapInfo);
    }
}
